<!--
 * @Author: HTT httishere0728@gmail.com
 * @Date: 2024-03-12 20:58:04
 * @LastEditors: HTT httishere0728@gmail.com
 * @LastEditTime: 2024-03-12 21:11:02
 * @FilePath: /widgets/forward.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Forward</title>
</head>

<body>
    <script>
        function getAllQueryParams() {
            // 创建一个URLSearchParams实例
            const urlSearchParams = new URLSearchParams(window.location.search);
            // 把键值对列表转换为一个对象
            const params = Object.fromEntries(urlSearchParams.entries());
            console.log(params)
            return params
        }
        // window.load = function() {
            const params = getAllQueryParams();
            const origin = 'https://httishere.gitee.io/notion/'
            const pathname = params?.wid.replace(' ', '/');
            let params_component = ''
            Object.keys(params).map(key => {
                if(key !== 'wid') {
                    params_component += `&${key}=${params[key]}`
                }
            })
            window.location.href = `${origin}${pathname}?${params_component}`
        // }
    </script>
</body>

</html>